package org.example.error;

public enum EmBusinessError implements CommonError{
    //通用错误类型
    PARAMETER_VALIDATION_ERROR(100001,"参数不合法"),
    UNKNOWN_ERROR(10002,"未知错误"),
    //以20000开头为用户错误信息
    USER_NOT_EXIST(20001,"用户不存在"),
    USER_NOT_LOGIN(20002,"账号或密码不正确")
    ;
    private EmBusinessError(int errCode,String errMsg)
    {
       this.errCode=errCode;
       this.errMsg=errMsg;
    }

    private int errCode;
    private String errMsg;
    @Override
    public int getErrCode() {
        return errCode;
    }

    @Override
    public String getErrMsg() {
        return errMsg;
    }

    @Override
    public CommonError setErrMsg(String errMsg) {
        this.errMsg=errMsg;
        return this;
    }
}
